<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>在线OJ-题目列表</title>
    <style>
        /* 全局重置与基础样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        :root {
            --primary: #2c3e50;
            --secondary: #3498db;
            --accent: #1abc9c;
            --light: #ecf0f1;
            --dark: #2c3e50;
            --success: #2ecc71;
            --warning: #f39c12;
            --danger: #e74c3c;
            --gray: #95a5a6;
            --bg-light: #f8f9fa;
            --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
            --transition: all 0.3s ease;
        }

        html, body {
            width: 100%;
            height: 100%;
            background-color: var(--bg-light);
            color: #333;
            line-height: 1.6;
        }

        /* 页面布局 - 确保页脚始终在底部 */
        body {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }

        .container {
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        /* 导航栏样式 */
        .navbar {
            width: 100%;
            height: 60px;
            background: linear-gradient(135deg, var(--primary), #1a2530);
            display: flex;
            align-items: center;
            padding: 0 5%;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            position: fixed;
            top: 0;
            z-index: 1000;
        }

        .navbar a {
            color: rgba(255, 255, 255, 0.85);
            text-decoration: none;
            padding: 0 1rem;
            height: 60px;
            display: flex;
            align-items: center;
            transition: var(--transition);
            font-weight: 500;
        }

        .navbar a:hover {
            color: white;
            background-color: rgba(255, 255, 255, 0.1);
        }

        .navbar .login {
            margin-left: auto;
            background-color: var(--accent);
            color: white;
            border-radius: 4px;
            padding: 8px 16px;
            height: auto;
        }

        .navbar .login:hover {
            background-color: #16a085;
            transform: translateY(-2px);
        }

        /* 主内容区域 */
        .main-content {
            flex: 1;
            padding-top: 60px;
            min-height: calc(100vh - 110px); /* 视口高度减去导航栏和页脚高度 */
            display: flex;
            flex-direction: column;
        }

        .question_list {
            max-width: 1000px;
            width: 100%;
            margin: 0 auto;
            padding: 2rem;
            flex: 1;
        }

        .page-header {
            text-align: center;
            margin-bottom: 2.5rem;
            position: relative;
        }

        .page-header h1 {
            font-size: 2.5rem;
            color: var(--primary);
            margin-bottom: 0.5rem;
            font-weight: 700;
        }

        .page-header::after {
            content: '';
            display: block;
            width: 80px;
            height: 4px;
            background: linear-gradient(to right, var(--secondary), var(--accent));
            margin: 1rem auto;
            border-radius: 2px;
        }

        /* 题目列表表格样式 */
        .question-table {
            width: 100%;
            background: white;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: var(--card-shadow);
            margin-bottom: 2rem;
        }

        .question-table table {
            width: 100%;
            border-collapse: collapse;
        }

        .question-table thead {
            background: linear-gradient(135deg, var(--primary), #34495e);
            color: white;
        }

        .question-table th {
            padding: 1.2rem 1rem;
            text-align: left;
            font-weight: 600;
            font-size: 1rem;
        }

        .question-table th:first-child {
            width: 15%;
            text-align: center;
        }

        .question-table th:nth-child(2) {
            width: 65%;
        }

        .question-table th:last-child {
            width: 20%;
            text-align: center;
        }

        .question-table tbody tr {
            border-bottom: 1px solid #eee;
            transition: var(--transition);
        }

        .question-table tbody tr:last-child {
            border-bottom: none;
        }

        .question-table tbody tr:hover {
            background-color: #f8f9fa;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
        }

        .question-table td {
            padding: 1.2rem 1rem;
            color: #555;
        }

        .question-table td:first-child {
            text-align: center;
            font-weight: 600;
            color: var(--primary);
        }

        .question-table td:last-child {
            text-align: center;
            font-weight: 600;
        }

        .question-table a {
            color: var(--dark);
            text-decoration: none;
            transition: var(--transition);
            display: block;
            font-weight: 500;
        }

        .question-table a:hover {
            color: var(--secondary);
        }

        /* 页脚样式 - 始终在底部 */
        .footer {
            background-color: var(--primary);
            color: rgba(255, 255, 255, 0.7);
            text-align: center;
            padding: 1.5rem;
            margin-top: auto; /* 关键属性，使页脚始终在底部 */
            width: 100%;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .navbar {
                padding: 0 1rem;
            }
            
            .question_list {
                padding: 1rem;
            }
            
            .page-header h1 {
                font-size: 2rem;
            }
            
            .question-table {
                overflow-x: auto;
            }
            
            .question-table table {
                min-width: 600px;
            }
        }
    </style>
</head>

<body>
    <div class="container">
        <!-- 导航栏 -->
        <div class="navbar">
            <a href="/">首页</a>
            <a href="/all_questions">题库</a>
            <a href="#">竞赛</a>
            <a href="#">讨论</a>
            <a href="#">求职</a>
            <a class="login" href="#">登录</a>
        </div>

        <!-- 主内容区域 -->
        <div class="main-content">
            <!-- 题目列表 -->
            <div class="question_list">
                <div class="page-header">
                    <h1>OnlineJuge题目列表</h1>
                </div>

                <div class="question-table">
                    <table>
                        <thead>
                            <tr>
                                <th>编号</th>
                                <th>标题</th>
                                <th>难度</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{#question_list}}
                            <tr>
                                <td>{{number}}</td>
                                <td><a href="/question/{{number}}">{{title}}</a></td>
                                <td>{{level}}</td>
                            </tr>
                            {{/question_list}}
                        </tbody>
                    </table>
                </div>
            </div>

            <!-- 页脚 - 现在会始终位于页面底部 -->
            <div class="footer">
                <h4>@hhhhhhh</h4>
            </div>
        </div>
    </div>

    <script>
        // 简单的交互效果
        document.addEventListener('DOMContentLoaded', function() {
            // 表格行点击效果
            const tableRows = document.querySelectorAll('.question-table tbody tr');
            tableRows.forEach(row => {
                row.addEventListener('click', function() {
                    const link = this.querySelector('a');
                    if (link) {
                        window.location.href = link.href;
                    }
                });
            });
        });
    </script>
</body>

</html>